<?php
class FP_Dao_UserPermission extends Doctrine_Record {

    public function setTableDefinition()
    {
        $this->setTableName('fp_user_permission');
        $this->option('charset', 'utf8');
        $this->option('collate', 'utf8_unicode_ci');
        $this->option('type', 'MyISAM');
        $this->hasColumn('id', 'integer', 4, array('type' => 'integer' ,'length' => 4, 'unsigned' => 1, 'primary' => true, 'autoincrement' => true ));
        $this->hasColumn('permission_id', 'integer', 4, array('type' => 'integer' ,'length' => 4, 'unsigned' => 1));
        $this->hasColumn('user_id', 'integer', 4, array('type' => 'integer' ,'length' => 4, 'unsigned' => 1 ));
    }

    public function setUp() {
	$this->hasOne('FP_Dao_Permission as Permission', array('local' => 'permission_id', 'foreign' => 'permission_id'));
	$this->hasOne('FP_Dao_User as User', array('local' => 'user_id', 'foreign' => 'user_id'));
    }

}
?>